#include<bits/stdc++.h>
#define int long long
using namespace std;
int a,b;
int f[100005];
map<int,int> ff;
const int mod=1e9+7;
void sub1(){
    f[a]=1;
    for(int i=a+1;i<=b;i++) f[i]=(f[i-1]+(!(i&1))*f[i/2])%mod;
    printf("%lld\n",f[b]);
}
signed main(){
    freopen("op.in","r",stdin); 
    freopen("op.out","w",stdout);
    scanf("%lld %lld",&a,&b);
    if(b<=100000){sub1();return 0;}
    return 0;
}